﻿using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xms.MQ
{
    public static class LIMUserTable
    {
        public static readonly ConcurrentDictionary<int, string> diclist = new ConcurrentDictionary<int, string>();

        public static void AddUser(int key, string value)
        {
            if (diclist.ContainsKey(key))
            {
                diclist[key] = value;
            }
            else
            {
                diclist.TryAdd(key, value);
            }
        }

        public static string GetValueByKey(int key)
        {
            if (diclist.ContainsKey(key))
            {
                return diclist[key];
            }
            else
            {
                return "";
            }
        }
    }
}
